﻿@using PagedList.Mvc;
@using PagedList;
@using MiniBottles.Models;
@{
    ViewBag.Title = @AppResource.MyCollection; ;
    int counter = 0;
    string action = ViewContext.RouteData.GetRequiredString("action");
    string controller = ViewContext.RouteData.GetRequiredString("controller");
    var list = (IPagedList)ViewBag.BottleList;
    
}

@section leftmenu
 {
    @Html.Action("Menu", "Home")
}

<h5 class="title">@ViewBag.Message</h5>
<div class="greystrip"></div>
<div class="whitestrip"></div>
@if (list.PageCount > 1)
{
    if (action == "Index")
    {
    @Html.PagedListPager(list, page => Url.Action(action, controller, new { page, query = ViewBag.Query, categoryId = ViewBag.CategoryId, collectionId = ViewBag.CollectionId }))
    
    }
    else
    {
    @Html.PagedListPager(list, page => Url.Action(action, controller, new { page }))
    }
}
<div class="clearfix"></div>
<div class="show-content">
    @foreach (Bottle bottle in ViewBag.BottleList)
    {
        counter++;
   
        @Html.Partial("_Bottle", bottle);

                                        if (counter % 5 == 0)
                                        {
        <div class="clearfix"></div>
                                        }

    }
</div>



<div class="clearfix"></div>
@if (list.PageCount > 1)
{
    if (action == "Index")
    {
    @Html.PagedListPager(list, page => Url.Action(action, controller, new { page, query = ViewBag.Query, categoryId = ViewBag.CategoryId, collectionId = ViewBag.CollectionId }))
    
    }
    else
    {
    @Html.PagedListPager(list, page => Url.Action(action, controller, new { page }))
    }
}